package com.exercise.api.feign;

import com.exercise.commons.param.BasePageParam;
import com.exercise.commons.vo.Paging;
import com.exercise.commons.vo.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "DeWu-storage-service",contextId = "productApi")
public interface ProductApiFeign {

    /**
     * 增加或修改商品
     *
     * @param product 商品
     * @return Product
     */
    @GetMapping("/product/save")
    int save(@RequestBody Product product);

    /**
     * 分页查询商品
     *
     * @param param 商品分页参数
     * @return PagingData<Product>
     */
    @GetMapping("/product/pageQueryProduct")
    Paging<Product> pageQueryProduct(@RequestBody BasePageParam param);

    /**
     * 根据主键id获取商品信息
     *
     * @param id 主键id
     * @return Product
     */
    @GetMapping("/product/get")
    Product get(@RequestBody String id);
}
